﻿IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[esf_sso].[VBasicReference]'))
	DROP VIEW [esf_sso].[VBasicReference]
GO

-- SELECT * FROM [esf_sso].[VBasicReference]

CREATE VIEW [esf_sso].[VBasicReference] WITH SCHEMABINDING
AS
	SELECT 
		BR.ID
		,BR.BasicReferenceTypeID
		,BR.Code
		,BR.Name
		,BR.Description
		,BR.IsEnabled
		,BR.CreationDateTime
		,BR.LastUpdateDateTime
		,BR.Extra_I
		,BR.Extra_II
		,BR.Extra_III
		,BR.UserCreationAlias
		,BR.UserLastUpdateAlias
		,BRT.Name BRT_Name
		,BRT.ID BRT_ID
	FROM
		esf_sso.BasicReference BR
	INNER JOIN
		esf_sso.BasicReferenceType BRT ON BRT.ID = BR.BasicReferenceTypeID
GO